<div class="sf_admin_list">
 <div id="Spacio_boton_tabla" style="padding-bottom: 8px">
    <input type="button" value="Filtros de Busquedas" onclick="jQuery('#dialog-form').dialog('open')">
 
 </div>
<?php if (!$pager->getNbResults()): ?>
    <p><?php echo __('No result', array(), 'sf_admin') ?></p>
  <?php else: ?>
    <table cellspacing="0">
      <thead>
        <tr>
          <th id="sf_admin_list_batch_actions"><input id="sf_admin_list_batch_checkbox" type="checkbox" onclick="checkAll();" /></th>
          <?php include_partial('modelos/list_th_tabular', array('sort' => $sort)) ?>
          <th id="sf_admin_list_th_actions"><?php echo __('Actions', array(), 'sf_admin') ?></th>
        </tr>
      </thead>
      <tfoot>
        <tr>
          <th colspan="5">
            <?php if ($pager->haveToPaginate()): ?>
              <?php include_partial('modelos/pagination', array('pager' => $pager)) ?>
            <?php endif; ?>

            <?php echo format_number_choice('[0] no result|[1] 1 result|(1,+Inf] %1% results', array('%1%' => $pager->getNbResults()), $pager->getNbResults(), 'sf_admin') ?>
            <?php if ($pager->haveToPaginate()): ?>
              <?php echo __('(page %%page%%/%%nb_pages%%)', array('%%page%%' => $pager->getPage(), '%%nb_pages%%' => $pager->getLastPage()), 'sf_admin') ?>
            <?php endif; ?>
          </th>
        </tr>
      </tfoot>
      <tbody>
        <?php foreach ($pager->getResults() as $i => $modelos): $odd = fmod(++$i, 2) ? 'odd' : 'even' ?>
          <tr class="sf_admin_row <?php echo $odd ?>">
            <?php include_partial('modelos/list_td_batch_actions', array('modelos' => $modelos, 'helper' => $helper)) ?>
            <?php include_partial('modelos/list_td_tabular', array('modelos' => $modelos)) ?>
            <?php include_partial('modelos/list_td_actions', array('modelos' => $modelos, 'helper' => $helper)) ?>
          </tr>
        <?php endforeach; ?>
      </tbody>
    </table>
   
  <?php endif; ?>
  
</div>

<style type="text/css">
		/*body { font-size: 62.5%; }
		label, input { display:block; } */
                input.text { margin-bottom:3px; width:30%; padding: .4em; }
		#modelos_filters_marcas_id,#modelos_filters_modelo { margin-bottom:3px; width:95%; padding: .4em; }
		
                fieldset { padding:0; border:0; margin-top:12px; }
		h1 { font-size: 1.2em; margin: .6em 0; }
		div#users-contain { width: 350px; margin: 20px 0; }
		div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
		div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
		.ui-dialog .ui-state-error { padding: .3em; }
		.validateTips { border: 1px solid transparent; padding: 0.3em; }

	</style>

<script type="text/javascript">
/* <![CDATA[ */
function checkAll()
{
  var boxes = document.getElementsByTagName('input'); for(var index = 0; index < boxes.length; index++) { box = boxes[index]; if (box.type == 'checkbox' && box.className == 'sf_admin_batch_checkbox') box.checked = document.getElementById('sf_admin_list_batch_checkbox').checked } return true;
}
//Agregado por Marcelo
jQuery(function() {
		// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
		jQuery("#dialog").dialog("destroy");

		var     clientestipo_descripcion = jQuery("#clientestipo_descripcion"),
		        allFields = jQuery([]).add(clientestipo_descripcion),
			tips = jQuery(".validateTips");

		function updateTips(t) {
			tips
				.text(t)
				.addClass('ui-state-highlight');
			setTimeout(function() {
				tips.removeClass('ui-state-highlight', 1500);
			}, 500);
		}

		function checkLength(o,n,min,max) {

			if ( o.val().length > max || o.val().length < min ) {
				o.addClass('ui-state-error');
				updateTips("La longitud de " + n + " debe estar entre "+min+" y "+max+".");
				return false;
			} else {
				return true;
			}

		}

		function checkRegexp(o,regexp,n) {

			if ( !( regexp.test( o.val() ) ) ) {
				o.addClass('ui-state-error');
				updateTips(n);
				return false;
			} else {
				return true;
			}

		}

		jQuery("#dialog-form").dialog({
			autoOpen: false,
			height: 230,
			width: 350,
			modal: true,
			close: function() {
				allFields.val('').removeClass('ui-state-error');
			}
		});

	});

//




/* ]]> */
</script>
